<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="{:U('Exchange/index')}">兑换列表</a></li>
     <li class="active"><a href="{:U('Exchange/add')}">添加兑换</a></li>
  </ul>
  

  <div class="common-form">
    <form method="post" class="form-horizontal J_ajaxForm" action="{:U('Exchange/add_post')}">
      <div class="table_list">
        <table cellpadding="2" cellspacing="2" width="100%" class="table table-hover">
          <tbody>
            <tr>
              <td>选择商品:</td>
              <td>
									<if condition="$sids">
						        <foreach name="sids" item="sid">
							        <foreach name="images" item="img">
												<if condition="$img['relatedID'] eq $sid">
								        	<img src="{$imgtituan}{$img.filepath}{$img.filename}" name="{$imgtituan}{$img.filepath}{$img.filename}" title="双击查看" width="80" height="45"ondblclick="image_priview(this.name);" >
													<input type="hidden" name="ids[]" value="{$sid}">
												</if>
							        </foreach>
						        </foreach>
										<a href="{:U('Exchange/shop',array('source'=>'add'))}">修改</a>
									<else/>
										<a href="{:U('Exchange/shop',array('source'=>'add'))}">关联商品</a>
									</if>
              </td>
            </tr>
            <tr>
              <td>活动类型:</td>
              <td>
              	<select name="itemtype" class="normal_select"> 
			        		<option value="0">请选择</option>
		        			<foreach name="activity" item="vo">
			        			<option value="{$vo.typeid}">{$vo.type_text}</option>
		              </foreach>
	               </select>
	            </td>
            </tr>
            <tr>
              <td>所属用户:</td>
              <td>
              	<select name="point_level" class="normal_select"> 
			        		<option value="0">请选择</option>
		        			<foreach name="typeconfigs" item="config">
			        			<option value="{$config.typeID}">{$config.typeName}</option>
		              </foreach>
	               </select>
	            </td>
            </tr>
            <tr>
              <td>描述:</td>
              <td><input type="text" class="input" name="description" value="{$items.itemDesc}"></td>
            </tr>
            <tr>
              <td>兑换类型:</td>
              <td>
              	<label class="radio"><input type="radio" name="typeid" value="100" ><span>一次活动</span></label>
								<label class="radio"><input type="radio" name="typeid" value="200" ><span>重复活动</span></label>
	        		</td>
            </tr>
            <tr>
              <td>兑换消耗:</td>
              <td><input type="text" class="input" name="points" value="{$price['amount']*1000}"></td>
            </tr>
            <tr>
              <td>商品总数:</td>
              <td><input type="text" class="input" name="cnt" value=""></td>
            </tr>
            <tr>
              <td>兑换状态:</td>
              <td>
              	<label class="radio"><input type="radio" name="status" value="100" checked><span>不兑换</span></label>
								<label class="radio"><input type="radio" name="status" value="200" ><span>可兑换</span></label>
              </td>
            </tr>
            <tr>
              <td>活动开始:</td>
              <td><input type="text" class="J_datetime" name="period_from" value="{:date('Y-m-d H:i',strtotime('+7 day'))}"></td>
            </tr>
            <tr>
              <td>活动结束:</td>
              <td><input type="text" class="J_datetime" name="period_to" value="{:date('Y-m-d H:i',strtotime('+14 day'))}"></td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="form-actions">
        <button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">添加</button>
        <button type="button" class="btn" onclick="javascript:history.go(-1);">返回</button>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript" src="__ROOT__/statics/js/common.js"></script>
<script type="text/javascript" src="__ROOT__/statics/js/content_addtop.js"></script>
</body>
</html>